package com.example.service.Impl;

import com.example.mapper.StudentMapper;
import com.example.pojo.Student;
import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    //添加
    @Override
    public void add(Student student) {
        studentMapper.insertStudent(student);
    }
    //查询
    @Override
    public Student query(Integer id) {
        Student student = studentMapper.queryById(id);
        return student;
    }
    //查询列表
    @Override
    public List<Student> list() {
        List<Student> list = studentMapper.list();
        return list;
    }
    //修改
    @Override
    public void update(Student student) {
        studentMapper.updateStudent(student);

    }
    //审核学员
    @Override
    public void approve(Integer id) {
        studentMapper.ApproveStudent(id);
    }

    //批量审核学员
    @Override
    public void batchApprove(List<Integer> ids) {
        studentMapper.batchApproveStudent(ids);
    }

    //批量导入用户
    @Override
    public void batchImport(List<Student> list1) {
        studentMapper.batchImproveStudent(list1);
    }
}
